package com.martin.fastframe.ui.holder

import android.view.View
import com.martin.fastframe.R
import com.martin.fastframe.databinding.ItemEmojiBinding
import com.martin.lib_base.annotation.ItemData
import com.martin.lib_base.base.BaseViewHolder
import com.martin.lib_base.bean.EmojiBean
import com.martin.lib_base.interfaces.IItemData

@ItemData(EmojiViewHolder.Companion.ItemData::class)
class EmojiViewHolder(view: View) : BaseViewHolder<EmojiBean, ItemEmojiBinding>(view) {
    override fun onBindViewHolder(position: Int, item: Any?) {

        getItemBean(item)?.let {
            binding.tv.text = it.parseToKey()
        }

        itemView.setOnClickListener {
            notifyItemClick()
        }
    }

    companion object {
        class ItemData : IItemData {
            override fun getItemLayoutId() = R.layout.item_emoji
        }
    }

}